package data.graph;

import java.util.ArrayList;


//Vertex define
public class Node {
	int id;
	String name;
	String label;
	ArrayList<Integer> neighbors;

	public Node() {
		this.name = "";
		this.label = "";
	}

	public Node(String name) {
		this.name = name;
	}

	public Node(Integer id, String name) {
		this.id = id;
		this.name = name;
	}

	public Node(Integer id, ArrayList<Integer> neighbors) {
		this.id = id;
		this.neighbors = neighbors;
	}

	public Node(Integer id, String label, ArrayList<Integer> neighbors) {
		this.id = id;
		this.label = label;
		this.neighbors = neighbors;
	}

	public Node(Integer id, String name, String label) {
		this.id = id;
		this.name = name;
		this.label = label;
	}

	@Override
	public boolean equals(Object obj) {
		boolean check = false;
		if (obj == null)
			return false;
		else if (obj == this)
			return true;
		else {
			if (obj instanceof Node && obj.getClass() == this.getClass()) {
				final Node t = (Node) obj;
				check = this.name.equals(t.name);
			}
		}
		return check;
	}

	@Override
	public int hashCode() {
		int hash = 7;
		hash = (37 * hash) + (null == this.name ? 0 : this.name.hashCode());
		return hash;
	}
}

